package com.basics.post.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.basics.api.response.channel.ChannelPostListData;
import com.basics.api.response.channel.PostOrMsgData;
import com.basics.post.entity.CyChannelPost;
import com.baomidou.mybatisplus.extension.service.IService;

/**
 * <p>
 * 频道帖子 服务类
 * </p>
 *
 * @author WangWei
 * @since 2025-03-09
 */
public interface CyChannelPostService extends IService<CyChannelPost> {

    /**
     * 获取频道最新帖子
     * @param channelId
     * @return
     */
    PostOrMsgData getLastPost(Long channelId);

    /**
     * 获取频道帖子列表
     * @param page
     * @param channelId
     * @param userId
     * @return
     */
    IPage<ChannelPostListData> selectChannelPostList(Page page, Long channelId, Long userId,String topicId);

    /**
     * 获取用户帖子数量
     * @param userId
     * @param organizationId
     * @return
     */
    int getPostNumByUserId(Long userId,Long organizationId);
}
